package com.imay.live.view.custom;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.imay.live.R;

/**
 * Created by Administrator on 2017/04/20 0020.
 */

public class AddCardAothView extends LinearLayout {
    TextView iv_auth_tip, tv_auth;

    public AddCardAothView(Context context) {
        super(context);
        init(context);
    }

    public AddCardAothView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    public AddCardAothView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }

    @RequiresApi(api = 21)
    public AddCardAothView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        init(context);
    }

    private ImageView iv_auth;
    private ImageView iv_addauth;

    private void init(Context context) {
        setOrientation(VERTICAL);
        View view = LayoutInflater.from(context).inflate(R.layout.addcard_auth, this, true);
        iv_auth_tip = (TextView) findViewById(R.id.iv_auth_tip);
        tv_auth = (TextView) findViewById(R.id.tv_auth);
        iv_auth = (ImageView) findViewById(R.id.iv_auth);
        iv_addauth = (ImageView) findViewById(R.id.iv_addauth);

    }

    public ImageView getIv_auth() {
        setInvisibel();
        return iv_auth;
    }

    private void setInvisibel() {
        iv_addauth.setVisibility(INVISIBLE);
        tv_auth.setVisibility(INVISIBLE);
        iv_auth_tip.setVisibility(INVISIBLE);
    }

    public void settip(CharSequence text, CharSequence textb) {
        iv_auth_tip.setText(text);
        tv_auth.setText(textb);
    }

}
